<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta charset="utf-8">
<title>商品表</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../res/css/layui.css" media="all">
<link rel="stylesheet" href="../../res/css/cst/snproduction.css"
	media="all">
<script type="text/javascript" src="../../res/js/jquery-1.11.2.min.js"></script>
</head>
<body>

	<div class="demoTable" style="margin-left: 20px; margin-top: 10px;">
		商品名称:
		<div class="layui-inline">
			<input class="layui-input" style="height: 32px;" id="comName" maxlength="7"
				autocomplete="off" placeholder="请输入商品名称">
		</div>
		

		商品类型:
				<from class="layui-form">
				<div class="layui-inline">
					<select lay-filter="aihao" id="typeSelect" style="width: 100px;">
					</select>
				</div>
				</from>

		<button class="layui-btn layui-btn-sm" data-type="reload"
			id="selectButton">搜索</button>
		<button class="layui-btn layui-btn-warm layui-btn-sm" id="insert">增加</button>

	</div>

	<table class="layui-table"
		lay-data="{ url:'../../commodity/findAll.action', page:true, id:'idTest'}"
		lay-filter="demo">
		<thead>
			<tr>
				<th lay-data="{type:'checkbox', fixed: 'left'}"></th>
				<th lay-data="{field:'comId',sort: true, align:'center',width:'220'}">商品编号</th>
				<th lay-data="{field:'comName',sort: true, align:'center',width:'250'}">商品名称</th>
				<th lay-data="{field:'typeName',align:'center',width:'100'}">药品类型</th>
				<th lay-data="{field:'comImage', align:'center',width:'100',sort: true,toolbar: '#Image'}">商品图片</th>
				<th lay-data="{field:'comUnit', align:'center',width:'100'}">商品单位</th>
				<th lay-data="{field:'ciTrade', align:'center',width:'100'}">批发价</th>
				<th lay-data="{field:'ciRetail', align:'center',width:'100'}">零售价</th>
				<th lay-data="{fixed: 'right',fixed: 'right',width:'190', align:'center', toolbar: '#barDemo'}">操作</th>
			</tr>
		</thead>
	</table>

<script type="textml" id="Image">
    <img style="width:30px;height:23px;" src="../../{{ d.comImage }}">
</script>

<script type="text/html" id="barDemo">
     <button class="layui-btn layui-btn-xs" lay-event="edit">编辑</button>
	 <button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</button>
	 <button class="layui-btn layui-btn-xs layui-btn-warm" lay-event="snBom">配置材料</button>
</script>

	<!-- 增加或修改的弹框 -->
	<div id="addOrUpdate" style="display: none;padding-bottom: 20px;">
		<form id="myform" onsubmit="return ss()"
		 action="../../commodity/addOrUpdate.action" class="layui-form" method="post"
			style="margin-top: 10px;" enctype="multipart/form-data">
			<input type="hidden" name="comId" id="comId" />
			<div class="aru">
				<label class="layui-form-label">商品名称:</label>
				<div class="layui-input-block">
					<input name="comName" id="comNameInput" onblur="findComName()" class="layui-input"
						placeholder="请输入商品名称" type="text">
					<input type="hidden"  class="fromYz" id="comNameYz">
				</div>
			</div>

			<div class="aru">
				<label class="layui-form-label">商品单位:</label>
				<div class="layui-input-block">
					<input name="comUnit" id="comUnit" onblur="findComUnit()"  class="layui-input" type="text"
						placeholder="请输入商品单位">
					<input type="hidden"  class="fromYz" id="comUnitYz">
				</div>
			</div>
			
			<div class="aru">
				<label class="layui-form-label">成本价:</label>
				<div class="layui-input-block">
					<input name="ciCost" id="ciCost" onblur="findCiCost()"  class="layui-input" type="text"
						placeholder="请输入进货价">
					<input type="hidden"  class="fromYz" id="ciCostYz">
				</div>
			</div>
	
			<div class="aru">
				<label class="layui-form-label">销售价:</label>
				<div class="layui-input-block">
					<input name="ciSales" id="ciSales"  onblur="findCiSales()" class="layui-input" type="text"
						placeholder="请输入进货价">
					<input type="hidden"  class="fromYz" id="ciSalesYz">
				</div>
			</div>
			
			<div class="aru">
				<label class="layui-form-label">批发价:</label>
				<div class="layui-input-block">
					<input name="ciTrade" id="ciTrade"  onblur="findCiTrade()" class="layui-input" type="text"
						placeholder="请输入批发价">
					<input type="hidden"  class="fromYz" id="ciTradeYz">
				</div>
			</div>
			
			<div class="aru">
				<label class="layui-form-label">零售价:</label>
				<div class="layui-input-block">
					<input name="ciRetail" id="ciRetail"  onblur="findCiRetail()" class="layui-input" type="text"
						placeholder="请输入零售价">
					<input type="hidden" class="fromYz" id="ciRetailYz">
				</div>
			</div>

			<div class="aru" class="layui-form-item">
				<label class="layui-form-label">商品类型:</label>
				<div class="layui-input-block">
					<select name="typeId" lay-verify="required" lay-search lay-filter="aihao" id="typeId" onchange="findTypeSelect();">
					</select>
					<input type="hidden" class="fromYz"  id="typeIdYz"> 
				</div>
			</div>
			
			<div class="aru">
			  <label class="layui-form-label">商品图片:</label>
			  <input type="button" class="layui-btn" id="comImage" lay-verify="comImage" name="comImage" value="上传图片">
			  <span id="FileName"></span>
			  <img class="layui-upload-img"  id="img" src="" name="img" style="width:30px;height:30px;">
			  <input type="hidden" class="fromYz" id="comImageYz">
			</div>

			<div class="aru">
				<div class="layui-input-block">
					<input type="button" onclick="FromSubmit();" class="layui-btn"  value="确认提交"/> <a
						href="javascript:exit();" class="layui-btn layui-btn-danger">关闭</a>
				</div>
			</div>
		</form>
	</div>
	<script src="../../res/layui.all.js" charset="utf-8"></script>
	<script type="text/javascript" src="../../res/js/cst/sncommodity.js"></script>
</body>
</html>